<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>商品详情</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm"/>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav fs_xl">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">商品详情</h1>
		</header>
		<div class="mui-content fs_xl">
			<div class="one_info">
				<div class="swiper-container">
					<div class="swiper-wrapper">
						<volist name="goods_images_list"  id="vo">
							<div class="swiper-slide"><img src="{$vo.image_url}" /></div>
						</volist>
					</div>
					<div class="pagination"></div>
				</div>
			</div>
			<if $goods.prom_type==0>
		    <div class="one_sp_tit fs_l">
				<p class="nohx fs_l">{$goods.goods_name}</p>
				<p class="nohx fs_l"><span class="fs_xl no_red">¥{$goods.shop_price}</span><span class="fs_xs">¥{$goods.market_price}</span><span class="fs_xs">{$goods.sales_sum}已售</span></p>
				<if $goods.deduction_amount != 0>
				<p class="manjian fs_xs"><span>满减</span>每满<em>{$goods.shop_price}</em>元，可减<em>{$goods.deduction_amount}</em>元现金</p>	
				</if>
				<if $goods.give_integral != 0>
				<p class="zengsong fs_xs"><span>赠送</span>完成评价并晒单再赠送{$goods.give_integral}银酒币</p>	
				</if>
		    </div>
			</if>
			<!--限时抢购-->
			<if $goods.prom_type==1>
			<div class="one_title xs_qg fs_xl cls">
				<div class="one_tit_lt">
					<span class="one_sp1 fs_xxs">¥<em class="fs_xi">{$activity_info.price}</em></span>
					<span class="one_sp2 fs_xs">¥{$goods.shop_price}</span>
					<span class="one_sp3 fs_xs">已抢{$activity_info.order_num}瓶,每人限购{$activity_info.buy_limit}瓶</span>
				</div>
				<div class="one_tit_rt">
					<p class="fs_xs">距促销活动结束</p>
					<p class="time_djs fs_xs" data-time="2017/7/01 00:00:00"><span class="db_d">00</span>:<span class="db_h">00</span>:<span class="db_m">00</span>:<span class="db_s">00</span></p>
				</div>
			</div>
			<div class="one_sp_tit fs_l">
				<p style="border-bottom: 0;"><span class="db_tit_1">{$activity_info.title}</span></p>
				<!--<p style="border-bottom: 0;">{$goods.sales_sum}已售</p>-->
				<if $goods.give_integral != 0>
				<p class="zengsong fs_xs"><span>赠送</span>完成评价并晒单再赠送{$goods.give_integral}银酒币</p>	
				</if>
			</div>
			</if>
			<!--团购-->
			<if $goods.prom_type==2>
			<div class="one_title xs_qg fs_xl cls">
				<div class="one_tit_lt">
					<span class="one_sp1 fs_xxs">¥<em class="fs_xi">{$activity_info.price} </em></span>
					<span class="one_sp2 fs_xs">¥{$goods.shop_price}</span>
					<span class="one_sp3 fs_xs">已有{$activity_info.order_num}人参团</span>
				</div>
				<div class="one_tit_rt">
					<p class="fs_xs">距团购活动结束</p>
					<p class="time_djs fs_xs" data-time="{$activity_info.end_time|date='Y/m/d H:i:s',###}"><span class="db_d">00</span>:<span class="db_h">00</span>:<span class="db_m">00</span>:<span class="db_s">00</span></p>
				</div>
			</div>
			<div class="one_sp_tit fs_l">
				<p style="border-bottom: 0;"><span class="db_tit_1">{$activity_info.title}</span></p>
				<p style="border-bottom: 0;" class="fs_s">{$goods.sales_sum}已售</p>
				<if $goods.give_integral != 0>
				<p class="zengsong fs_xs"><span>赠送</span>完成评价并晒单再赠送{$goods.give_integral}银酒币</p>	
				</if>
			</div>
			</if>
			<!--促销优惠-->
			<if $goods.prom_type==3>
			<div class="one_title xs_qg fs_xl cls">
				<div class="one_tit_lt">
					<span class="one_sp1 fs_xxs">¥<em class="fs_xi">{$goods.shop_price} {$activity_info.name}</em></span>

				</div>
				<div class="one_tit_rt">
					<p class="fs_xs">距促销活动结束</p>
					<p class="time_djs fs_xs" data-time="{$activity_info.end_time|date='Y/m/d H:i:s',###}"><span class="db_d">00</span>:<span class="db_h">00</span>:<span class="db_m">00</span>:<span class="db_s">00</span></p>
				</div>
			</div>
			<div class="one_sp_tit fs_l">
				<p><span class="db_tit_1">{$goods.goods_name}</span></p>
			</div>
			</if>
			<div class="one_m_info">
				<div class="one_top cls">
					<ul class="cls">
						<li class="active">图文详情</li>
						<li>商品参数</li>
						<li>评论</li>
					</ul>	
				</div>
				<div class="one_info_m">
					<div class="one_item active">
						{$goods.goods_content|htmlspecialchars_decode}
					</div>
					<div class="one_item canshu">
						<volist name="goods_attr_list"  id="vo">
							<p>{$goods_attribute[$vo.attr_id]}:<span>{$vo.attr_value}</span></p>
						</volist>
					</div>
					<div class="one_item one_pl" >
						<ul>
							<volist name="comment_list" id="vo">
								<li>
									<div class="pl_tit">
										<span class="pl_tx"><img src="{$vo.head_pic}" /></span>
										<span class="pl_name fs_m">{$vo.username}</span>
										<span class="pl_time fs_xs">{$vo.add_time|date="y-m-d",###}</span>
									</div>
									<div class="pl_info">
										<p class="fs_xs">{$vo.content|htmlspecialchars_decode}</p>
										<p class="cls">
											<volist name="vo.img" id="voo">
												<span><img src="{$voo}" /></span>
											</volist>
										</p>
									</div>
								</li>
							</volist>
						</ul>
						<p style="text-align:center;padding-top:0.5em;"><a class="fs_s" href="{:U('Mobile/Goods/goods_comment',array('id'=>$vo.goods_id))}">查看更多评论</a></p>
					</div>
				</div>				
			</div>
			<div class="nav fs_xl">
				<a class="kf" target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=526895676&site=qq&menu=yes">
					<p class="mui-icon iconfont icon-kefu fs_i"></p>
					<p class="fs_s">客服</p>
				</a>
				<a class="dp" href="{:U('Mobile/Cellar/factoryInfo',array('id'=>$goods.suppliers_id))}">
					<p class="mui-icon iconfont icon-dianpu fs_i"></p>
					<p class="fs_s">店铺</p>
				</a>
				<a href="javascript:;" class="btn1 fs_m" onClick="AjaxAddCart({$goods.goods_id},1,0);">加入购物车</a>
				<a href="javascript:;" class="btn2 fs_m" onClick="AjaxAddCart({$goods.goods_id},1,1);">立即购买</a>
			</div>
		</div>
		<a class="gwc_xf fs_xl" href="{:U('Cart/cart')}"><img src="__STATIC__/images/gwc021211.png" /></a>
		<script type="text/javascript">
			mui.init();
			$(".device,.swiper-container").height($(".swiper-slide img").height());
			$(".swiper-container1").height($(".swiper-slide").height());
			$(window).resize(function() {
				$(".device,.swiper-container").height($(".swiper-slide img").height());
				$(".swiper-container1").height($(".swiper-slide").height());
			});
			var sp_L=$(".one_sp1").width()+6;
			$(".one_sp2").css("left",sp_L);
			$(".one_sp3").css("left",sp_L);
		</script>
		<script>
			var mySwiper = new Swiper('.swiper-container', {
				pagination: '.pagination',
				loop: true,
				autoplay : 5000,
				grabCursor: true,
				autoplayDisableOnInteraction : false,
				paginationClickable: true
			});
			$(function(){
				$(".one_top li").click(function () {
        			$(".one_top li").removeClass("active").eq($(".one_top li").index(this)).addClass("active");
        			$(".one_item").hide().eq($('.one_top li').index(this)).show();
    		    });	
			})
		</script>
		
		<if $goods.prom_type==1>
		<script>
		    setInterval("sdsd()",1000);
			var t1=$(".time_djs").attr("data-time");
			function sdsd(){
      			show_time(t1,".db_d",".db_h",".db_m",".db_s");
      		}

      		show_time(t1,".db_d",".db_h",".db_m",".db_s");
			function show_time(T1,id1,id2,id3,id4) {
				var time_start = new Date().getTime(); //设定当前时间
				var time_end = new Date(T1).getTime(); //设定目标时间
				// 计算时间差
				var time_distance = time_end - time_start;// 天
				if(time_distance>0){
					var int_day = Math.floor(time_distance / 86400000)
					time_distance -= int_day * 86400000;// 时
					var int_hour = Math.floor(time_distance / 3600000)
					time_distance -= int_hour * 3600000;// 分
					var int_minute = Math.floor(time_distance / 60000)
					time_distance -= int_minute * 60000;// 秒 
					var int_second = Math.floor(time_distance / 1000)
					if(int_day < 10) {
						int_day = "0" + int_day;
					}// 时分秒为单数时、前面加零
					if(int_hour < 10) {
						int_hour = "0" + int_hour;
					}
					if(int_minute < 10) {
						int_minute = "0" + int_minute;
					}
					if(int_second < 10) {
						int_second = "0" + int_second;
					}
					$(id1).html(int_day);
					$(id2).html(int_hour);
					$(id3).html(int_minute);
					$(id4).html(int_second);// 显示时间 				
//					setTimeout("show_time()", 1000);// 设置定时器
				}else{
					$(".btn1,.btn2").css("pointer-events","none");
					$(".btn1,.btn2").css("background","#666");
				}
			}
		</script>
		</if>
		<if $goods.prom_type==2>
		<script>
		    setInterval("sdsd()",1000);
			var t1=$(".time_djs").attr("data-time");
			function sdsd(){
      			show_time(t1,".db_d",".db_h",".db_m",".db_s");
      		}

      		show_time(t1,".db_d",".db_h",".db_m",".db_s");
			function show_time(T1,id1,id2,id3,id4) {
				var time_start = new Date().getTime(); //设定当前时间
				var time_end = new Date(T1).getTime(); //设定目标时间
				// 计算时间差
				var time_distance = time_end - time_start;// 天
				if(time_distance>0){
					var int_day = Math.floor(time_distance / 86400000)
					time_distance -= int_day * 86400000;// 时
					var int_hour = Math.floor(time_distance / 3600000)
					time_distance -= int_hour * 3600000;// 分
					var int_minute = Math.floor(time_distance / 60000)
					time_distance -= int_minute * 60000;// 秒 
					var int_second = Math.floor(time_distance / 1000)
					if(int_day < 10) {
						int_day = "0" + int_day;
					}// 时分秒为单数时、前面加零
					if(int_hour < 10) {
						int_hour = "0" + int_hour;
					}
					if(int_minute < 10) {
						int_minute = "0" + int_minute;
					}
					if(int_second < 10) {
						int_second = "0" + int_second;
					}
					$(id1).html(int_day);
					$(id2).html(int_hour);
					$(id3).html(int_minute);
					$(id4).html(int_second);// 显示时间 				
//					setTimeout("show_time()", 1000);// 设置定时器
				}else{
					$(".btn1,.btn2").css("pointer-events","none");
					$(".btn1,.btn2").css("background","#666");
				}
			}
		</script>
		</if>
	</body>

</html>